﻿@{
    ViewBag.Title = "Index";
}
@using PeopleSource.Entities
@using PeopleSource.Utl
<div class="resumesearch">
简历类型：@Html.DropDownList("resumetype", new SelectList(CH.GetAllDatas<ResumeType>(), "ID", "ResumeTypeName"), "-请选择-")
简历类型：@Html.DropDownList("jobtitle", new SelectList(CH.GetAllDatas<JobTitle>(), "ID", "JobTitleName"), "-请选择-")
应聘人/电话：@Html.TextBox("applyer")
<input id="searchcontent"  type="button"   value="搜索"/>
</div>
<script type="text/javascript">
    $('document').ready(function () {

        $('#resumetype, #jobtitle,#applyer').change(function () {
            SearchResume();

        });

        $('#searchcontent').click(function () {
            SearchResume();
        });
    });
   
  function onDataBinding(e) {
      var resumetype = $('#resumetype').val();
      var jobtitle = $('#jobtitle').val();
      var applyer = $('#applyer').val();
      e.data = {
          jobtitle: jobtitle,
          resumetype: resumetype,
          applyer: applyer
      };
  }
    function SearchResume() {
        $("#Resume").data("tGrid").ajaxRequest();
    }
</script>
@(Html.Telerik().Grid<Resume>().Name("Resume").DataKeys(keys => { keys.Add(item => item.ID); })
    .ToolBar(toolBar => toolBar.Insert())
        .ClientEvents(c => c.OnDataBinding("onDataBinding"))
        .DataBinding(dataBinding =>
        {
            dataBinding.Ajax()
            .Select("_SelectIndex", "Resume")
            .Insert("_InsertAjaxEditing", "Resume")
            .Update("_SaveAjaxEditing", "Resume")
            .Delete("_DeleteAjaxEditing", "Resume");
        })
            .Columns(columns =>
            {
                columns.Bound(item => item.Name);
                columns.Bound(item => item.College);
                columns.Bound(item => item.Degree);
                columns.Bound(item => item.Mobile);
                columns.Bound(item => item.Email);
               // columns.Bound(item => item.JobTitle.JobTitleName);
                columns.Bound(item => item.ExpectSalary);
                columns.Command(commands =>
                {
                    commands.Edit();
                    //commands.Delete();
                }).Title("操作").Width(200);
            }).Resizable(r => r.Columns(true))
            .Editable(editing => editing.Mode(GridEditMode.PopUp))
                .Pageable(item => item.Style(GridPagerStyles.Status).PageSize(50).PageOnScroll(true)).Scrollable(s => s.Height(600)).Scrollable(c => c.Height(600))
    .Resizable(resizing => resizing.Columns(true))
            .Sortable()
        )
        <style>
            .resumesearch{ background-color: #fff;color: #333; border:1px solid #768ca5; padding:10px; margin-bottom:10px;}
            #resumetype{margin-right:10px;}
            #jobtitle{margin-right:10px;}
        </style>

